import { onMounted, ref } from "vue";
import { getBannerAPI } from "@/apis/home";

export const useBanner = () => {
    const bannerList = ref([])
    // 获取轮播图
    const getBanner = async () => {
        const res = await getBannerAPI({
            distributionSite: '2'
        }
        )
        // console.log(res)
        bannerList.value = res.result
    }
    onMounted(() => {
        getBanner()
    })

    return {
        bannerList
    }
}